//2009/08/10 01:40:49
#include <string>
#include <vector>
#include <map>
#include <queue>
#include <algorithm>

using namespace std;

class RGBColor
{
public:
    vector <int> getComplement(vector <int> rgb)
    {
        vector<int> ret;
        if (abs(rgb[0] * 2 - 255) <= 32 && abs(rgb[1] * 2 - 255) <=32 && abs(rgb[2] * 2 - 255) <=32)
            for (int i=0; i<3; i++)
            {
                if (rgb[i] > 128)
                    ret.push_back(rgb[i] - 128);
                else
                    ret.push_back((rgb[i] + 128) % 256);
            }
        else
            for (int i=0; i<rgb.size(); i++)
            {
                ret.push_back(255 - rgb[i]);
            }
        return ret;
    }
};
